package com.friends.utils.file;


public enum FileTypeEnum {

    EXCEL("excel", "表格"),
    WORD("doc", "word文档"),
    DEFAULT("default", "默认文件类型");

    private String type;

    private String desc;

    FileTypeEnum(String type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static FileTypeEnum byType(String type) {
        for (FileTypeEnum typeEnum : FileTypeEnum.values()) {
            if (typeEnum.type.equals(type)) {
                return typeEnum;
            }
        }

        return DEFAULT;
    }

    public String getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

}
